import 'dart:ui';

import 'package:flustars/flustars.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:oktoast/oktoast.dart';
import 'module_config.dart';
import 'module_wallet_authentication.dart';
import 'start/pages/wallet_start_page.dart';

void main() async{
  WidgetsFlutterBinding.ensureInitialized();

  String initRoute = window.defaultRouteName;
  print('initRoute: $initRoute');

  if(initRoute.isNotEmpty) {
    ModuleConfig.moduleName = null;
  }

  await SpUtil.getInstance();

  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {

    return OKToast(
      position: ToastPosition.bottom,
      child: MaterialApp(
        debugShowCheckedModeBanner: false,
        title: 'Flutter Demo',
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        home: WalletStartPage(),
        onGenerateRoute: ModuleWalletAuthentication().onGenerateRoute,
        // home: PINSettingPage(),
      ),
    );
  }
}
